Page({
    data: {
        mnavbarsData: ["selector01", "selector02", "selector03"],
        activeIndex: 0,
        mtranslatex: 0
    },
    onLoad: function(){
        this.setData({ // 开始距离
            mtranslatex: this.getmscreenWidth() / 750 * 26
        });
    },
    mnavbarclik: function (e) { // 导航点击
        // cosnol
        this.setData({
            activeIndex: e.currentTarget.id
        });
        if (e.currentTarget.id == 0) {
            this.setData({
                mtranslatex: this.getmscreenWidth() / 750 * 26
            });
        }
        if(e.currentTarget.id == 1){
            this.setData({
                mtranslatex: this.getmscreenWidth() / 750 * 270
            });
        }
        if (e.currentTarget.id == 2) {
            this.setData({
                mtranslatex: this.getmscreenWidth() / 750 * 540
            });
        }
    },
    getmscreenWidth: function(){  // 得到屏幕的宽度
        let mscreenWidth = 0;
        wx.getSystemInfo({
            success: function (res) {
                mscreenWidth = res.screenWidth
            },
        });
        return mscreenWidth;
    }
})